package com.stoken.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.stoken.domain.MemberTransinList;
import com.symbio.commons.Page;
import com.symbio.dao.hibernate.GenericDaoImpl;
import com.symbio.utils.HibernateUtils;

/**
 * 会员转入明细表
 * @author Frzhao
 *
 */
@Repository
public class MemberTransinListDao extends GenericDaoImpl<MemberTransinList, Long> {
	public Page<MemberTransinList> find(Page<MemberTransinList> pageData,String baseName) {
		Criteria criteria = HibernateUtils.createCriteria(getSession(), entityClass);
		
		criteria.createAlias("baseUsername", "memberbaseInfo",Criteria.INNER_JOIN, Restrictions.eq("memberbaseInfo.baseUsername", baseName)); 	
	
		
		HibernateUtils.setParameter(criteria, pageData);
		
		pageData.setResult(criteria.list());
		
		return pageData;				
	}
}
